package cn.edu.scau.cmi.suwenpeng.chapter01;

public class MyPoint {
   double x,y;
   public void setX(double x) {
	   this.x=x;
   }
   public double getX() {
	   return x;
   }
   public void setY(double y) {
	   this.y=y;
   }
   public double getY() {
	   return y;
   }
   MyPoint(){
	   x=0.0;
	   y=0.0;
	  }
   MyPoint(double x,double y){
	   this.x=x;
	   this.y=y;
	  }
   double distance(MyPoint myPoint) {
	   double subX=myPoint.getX()-this.x;
	   double subY=myPoint.getY()-this.y;
	   double result=Math.sqrt(subX*subX+subY*subY);
			   return result;
   }
}
